<?php
class My_Plugin_WatchDog extends Zend_Controller_Plugin_Abstract {
    public function preDispatch(Zend_Controller_Request_Abstract $request){
        if(is_file(CONFIG_PATH . '/watchdog.ini')){
            $configWatchDog = new Zend_Config_Ini(CONFIG_PATH . '/watchdog.ini', APPLICATION_ENV);
            if(isset($configWatchDog->key) && in_array($request->action, $configWatchDog->key->toArray()) && $request->controller == 'sig'){
                    $allow_to_auth = new Zend_Session_Namespace('allow_to_auth_'.NAME_SPACE);
                    $allow_to_auth->allowed = true;
            }elseif(!isset($configWatchDog->key)){
                $allow_to_auth = new Zend_Session_Namespace('allow_to_auth_'.NAME_SPACE);
                $allow_to_auth->allowed = true;
            }
        }else{
            $allow_to_auth = new Zend_Session_Namespace('allow_to_auth_'.NAME_SPACE);
            $allow_to_auth->allowed = true;
        }
    }
}